home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / tsetguid.zip / TEA / SET / SAMPLE / TICKER.JAV < prev    next >
Text File  |  1997-02-27  |  2KB  |  65 lines

  1. /*
  2.  * Copyright (c) 1996-1997, InetSoft Technology Corp, All Rights Reserved.
  3.  *
  4.  * The software and information contained herein are copyrighted and 
  5.  * proprietary to InetSoft Technology Corp. This software is furnished 
  6.  * pursuant to a written license agreement and may be used, copied, 
  7.  * transmitted, and stored only in accordance with the terms of such 
  8.  * license and with the inclusion of the above copyright notice. Please 
  9.  * refer to the file "COPYRIGHT" for further copyright and licensing 
  10.  * information. This software and information or any other copies 
  11.  * thereof may not be provided or otherwise made available to any 
  12.  * other person. 
  13.  */
  14. package tea.set.sample;
  15.  
  16. import java.applet.*;
  17. import java.awt.*;
  18. import tea.set.*;
  19. import java.net.*;
  20.  
  21. /**
  22.  * This is a demo applet to show using tea.set.TickerTape to build an
  23.  * information announcement board.
  24.  *
  25.  * @see TickerTape
  26.  * @version 1.3, 01/31/97
  27.  * @author InetSoft Technology Corp
  28.  */
  29. public class Ticker extends Applet {
  30.    public void init() {
  31.       setLayout(new BorderLayout());
  32.       
  33.       ticker1 = new TickerTape(mess, 1);
  34.       ticker1.setForeground(Color.green);
  35.       ticker1.setBackground(Color.black);
  36.       add("North", ticker1);
  37.       
  38.       try {
  39.      URL url = new URL(getDocumentBase(), "Ticker.txt");
  40.      
  41.      ticker2 = new TickerTape(url, 5, TickerTape.LINE_SCROLL);
  42.      ticker2.setWidth(20);
  43.      add("Center", ticker2);
  44.       }
  45.       catch(Exception e) {
  46.      e.printStackTrace();
  47.       }
  48.    }
  49.    
  50.    public void start() {
  51.       ticker1.start();
  52.       ticker2.start();
  53.    }
  54.    
  55.    public void stop() {
  56.       ticker1.stop();
  57.       ticker2.stop();
  58.    }
  59.    
  60.    String mess = "INTC 96 1/2  IDTI 12 3/8  MSFT 122 1/8  IFMX  45 1/4  " +
  61.    "ORCL 41 3/4  NOVL 10 3/8  T 56  ALSC 10 1/2  SIII 12 1/8  MU 40 1/8";
  62.    TickerTape ticker1;
  63.    TickerTape ticker2;
  64. }
  65.